package acwing.二分;

import java.util.Scanner;

/**
 * @description:
 * @author: qian
 * @createDate: 2021/11/20
 */
public class 分巧克力 {
    
    static int N = 100010, n , k;
    static int[] h = new int[N], w = new int[N];

    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        n = s.nextInt();
        k = s.nextInt();
        for (int i = 0; i < n; i++) {
            h[i] = s.nextInt();
            w[i] = s.nextInt();
        }
        int l = 1;
        int r = 100001;
        while (l < r) {
            int mid = l + r + 1 >> 1;
            if (check(mid)) l = mid;
            else r = mid - 1;
        }
        System.out.println(r);
    }

    private static boolean check(int mid) {

        int res = 0;
        // 矩形可以分多少快正方形
        for (int i = 0; i < n; i++) {
            res += (h[i] / mid) * (w[i] / mid);
        }
        return res >= k;
    }
}
